package conexion;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.ResourceBundle;

public class BDConexion {
	
			private static ResourceBundle rb = ResourceBundle.getBundle("infoBd");
			
			
			static{
				try {
					Class.forName(rb.getString("driver"));
				} catch (ClassNotFoundException e) {
					e.printStackTrace();
				}
			}

			public Connection  obtenerConexion(){
				Connection salida = null;
				try {
					salida = DriverManager.getConnection(
											rb.getString("url"),
											rb.getString("username"),
											rb.getString("password"));
				} catch (SQLException e) {
					e.printStackTrace();
				}
				return salida;	
			}
}
